package com.ruoyi.LXHappointment.controller;


import com.ruoyi.LXHappointment.service.IAppointmentSysUserService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 预约模块医生选择控制器
 * 与投诉模块控制器路径区分，避免冲突
 */
//@Api(tags = "预约模块-医生选择接口")
@RestController
@RequestMapping("/LXHAppointment/doctor")
public class AppointmentDoctorController extends BaseController {

    @Autowired
    private IAppointmentSysUserService appointmentSysUserService;

    /**
     * 根据当前登录用户ID查询所属团队医生
     * 自动从上下文获取当前用户ID，无需前端传递
     */
//    @ApiOperation("查询当前用户所属团队医生（预约用）")
    @GetMapping("/selectCurrentTeam")
    public AjaxResult selectCurrentTeamDoctors() {
        Long currentUserId = getUserId(); // 从框架上下文获取当前用户ID
        List<Map<String, Object>> doctors = appointmentSysUserService.selectTeamDoctorsByUserId(currentUserId);
        return AjaxResult.success(doctors);
    }
}